package cn.itrip.commons;

import cn.itrip.dto.Dto;

/**
 * @author Super God Jie
 * @version 1.0  2022-04-14 19:49
 */
public class DtoUtils {

	public static Dto returnSuccess(Object data){
		return new Dto().setData(data)
		.setSuccess("true")
		.setErrCode("0")
		.setMsg(null);
	}

	public static Dto returnFail(String errCode,String msg){
		return new Dto().setErrCode(errCode)
				.setMsg(msg)
				.setSuccess("false")
				.setData(null);
	}

	public static Dto ok(String msg,Object data){
		return new Dto().setErrCode("0")
				.setMsg(msg)
				.setSuccess("true")
				.setData(data);
	}
}
